﻿// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
//
// App.xaml.h
// Declaration of the App class.
//

#pragma once

#include "App.g.h"

// Required by generated header
#include "Common\BooleanToVisibilityConverter.h"
#include "Common\BooleanNegationConverter.h"
#include "DateTimeToStringConverter.h"
#include "DirectXPage.xaml.h"
#include "FloatToStringPrecipitationConverter.h"
#include "ForecastToButtonColorConverter.h"
#include "DataModel\Forecast.h"
#include "DataModel\ForecastGroup.h"
#include "BooleanNegationToVisibilityConverter.h"
#include "IntegerToStringTemperatureConverter.h"
#include "LogMessageToColorConverter.h"
#include "TemperatureToColorConverter.h"

namespace Weathr
{
    /// <summary>
    /// Provides application-specific behavior to supplement the default Application class.
    /// </summary>
    ref class App sealed
    {
    public:
        App();
        virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;

    internal:
        void ActivateLaunch(Windows::UI::Xaml::Interop::TypeName navigateTo, Platform::Object^ parameter, Windows::ApplicationModel::Activation::IActivatedEventArgs^ e, bool navigateToLandingPage);

    protected:
        virtual void OnSearchActivated(Windows::ApplicationModel::Activation::SearchActivatedEventArgs^ pArgs) override;
        virtual void OnWindowCreated(Windows::UI::Xaml::WindowCreatedEventArgs^ e) override;

    private:
        void OnSuspend(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
        void OnResume(Platform::Object^ sender, Platform::Object^ e);
        DirectXPage^ m_directXPage;
        Windows::UI::Xaml::Controls::Frame^ m_rootFrame;
        std::shared_ptr<ExceptionPolicy> m_exceptionPolicy;
    };
}
